// pages/team/team.js 
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    info:[],
    money: '0',
    total: '0',
    direct: '0',
    fission: '0',
    enough:false,
    list: [
      {
        img: '/images/dist1.png',
        text: '收益明细',
        path: '/pages/profit/profit'
      }, {
        img: '/images/dist2.png',
        text: '我的团队',
        path: '/pages/team/team'
      }, {
        img: '/images/dist3.png',
        text: '提现记录',
        path: '/pages/withdrawList/withdrawList'
      }
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var that= this;
    wx.request({
      url: app.siteInfo.shoppath +'distributioninfo',
      data:{
        uid: app.siteInfo.uid,
        pid: app.siteInfo.pid,
        com_part_id:app.siteInfo.com_part_id,
      },
      method:"get",
      success:function(res){
        console.log(res)
        that.setData({
          info:res.data.user
        })

      }
    })
  },
  noenough:function(){
    var that = this;
    wx.showToast({
      title: '不满足提现条件' + that.data.info.withdrawStandard,
      icon:"none"
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  // onShareAppMessage: function () {

  // }
})